package exam;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author blh
 * @date 2024年06月28日 10:58
 */

public class xiaomi1 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        for (int i = 0; i < T; i++) {
            int N = in.nextInt();
            int n = in.nextInt();
            int c = in.nextInt();
            int[] a = new int[n];
            for (int j = 0; j < n; j++) {
                a[j] = in.nextInt();
            }
            // 感觉是动态规划
            // dp[i]是指容量为i时最多装多少
            int[] dp = new int[N+1];

            Arrays.sort(a);

            // 先物品后背包
            for (int i1 = 0; i1 < n; i1++) {
                for (int j = a[i1]; j <= N; j++) {
                    dp[j] = Math.max(dp[j], dp[j-a[i1]]+a[i1]);
                }
            }

            if ((dp[N]+c) >= N){
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
}
